嵌套作用域(Nested Scopes)是在Python 2.1版引入的,它改变了Python的LGB(Local, Global, Build-In)的规则(当然是有限的)。
基于40个网页-相关网页
nested scope of identifier [计] 标识符的嵌套作用域
The event handler contains a nested scope called NestedScope. The following variables are defined
该事件处理程序包含一个嵌套范围 NestedScope。
An identifier may be defined once in a scope, but can be redefined in nested scopes. The following example will explain some of these points.
一个标识可以在一个作用域中定义一次,但可以在嵌套作用域中重新定义。
A local variable is one that is only available for use (that is, you can assign to it, or fetch its value) within the scope in which it is declared, and within nested scopes as well.
本地变量是仅可以在声明它的范围中和嵌套范围中使用的变量(也就是说,您可以向其赋值,也可以从中取值)。
应用推荐